﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using papercut2.Data.ImageProcess;

namespace papercut2.Data.test
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
                Gray.Pic =  new Bitmap(pictureBox1.Image);
                pictureBox1.Image = Gray.GrayPictrue();
                pictureBox1.Refresh();
        }

        private void button6_Click(object sender, EventArgs e)
        {
            OpenFileDialog ofdlg = new OpenFileDialog();
            ofdlg.Filter = "Bmp Files(*.bmp)|*.bmp|Gif Files（*.gif)| *.gif|Jpg Files(*.jpg)|*.jpg";
            if (ofdlg.ShowDialog() == DialogResult.OK)
            {
                Bitmap image = new Bitmap(ofdlg.FileName);
                pictureBox1.Image = image;
            }
        }

        private void button2_Click(object sender, EventArgs e)
        {
            Binarization.Pic = Gray.Pic;
            pictureBox1.Image = Binarization.BinarizationPictrue();
            pictureBox1.Refresh();
        }

        private void button3_Click(object sender, EventArgs e)
        {
            GetBorder.Pic = Binarization.Pic;
            pictureBox1.Image = GetBorder.getBorderPicture();
            pictureBox1.Refresh();

        }
    }
}
